package com.start_eternity.oasissafewalk.mapper;

import com.start_eternity.oasissafewalk.pojo.OrderDetails;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * author:ZhangT
 * Date:2024 / 03 / 30 / 10:36
 * Description:
 */
public interface OrderDetailsMapper {

    //根据订单号details Id查询
    @Select("select * from `order_details` where order_detail_id = #{id}")
    OrderDetails queryById(@Param("id") Integer id);

    //根据订单号No查询
    @Select("select * from `order_details` where order_no_id = #{no}")
    OrderDetails queryByNo(@Param("no") String no);

    //插入数据
    @Insert("insert into `order_details`(order_no_id,from_place_id,to_place_id) values (#{orderNoId}, #{fromPlaceId}, #{toPlaceId})")
    int insertDetails(OrderDetails orderDetails);

    //根据订单号No 修改数据
    int updateDetailsByNo(OrderDetails orderDetails);

    //根据订单号No 修改数据
    int updateDetailsById(OrderDetails orderDetails);
}
